<?php
// +-------------------------------------------------------------------------+
// | Mobile Melody Plug-in for PHP Melody ( www.phpsugar.com )
// +-------------------------------------------------------------------------+
// | MOBILE MELODY IS NOT FREE SOFTWARE
// | If you have downloaded this software from a website other
// | than www.phpsugar.com or if you have received
// | this software from someone who is not a representative of
// | phpSugar, you are involved in an illegal activity.
// | ---
// | In such case, please contact: support@phpsugar.com.
// +-------------------------------------------------------------------------+
// | Developed by: phpSugar (www.phpsugar.com) / support@phpsugar.com
// | Copyright: (c) 2004-2012 PhpSugar.com. All rights reserved.
// +-------------------------------------------------------------------------+
session_start();
$page_type = 'video';
include('settings.php');
$meta_title = $lang['login']." - "._SITENAME;
include('header.php');

$ref = get_last_referer();
$info_msg = '';

if($_GET['errors'] == 1 && $logged_in != 1)
	$info_msg .= $lang['login_msg3'];
elseif($logged_in == 1)
	$info_msg .= $lang['loggedin'];
?>
<div id="welcome">
<strong><?php echo $lang['login']; ?></strong>
<?php echo $info_msg; ?>
</div>
<div id="content">

<?php
if($logged_in != 1) {
?> 
	<form action="signin.php" method="post" name="login_form" class="login" autocomplete="off">
	<input name="username" type="text" size="15" class="inputtext" placeholder="<?php echo $lang['username'];?>" autofocus="autofocus" />
	<input name="pass" type="password" size="15" class="inputtext" placeholder="<?php echo $lang['password'];?>" />
	<input type="hidden" name="ref" value="<?php echo $ref; ?>" />
	<button class="submit border2" name="Login"><?php echo $lang['login']; ?></button>
	</form>
<?php
} elseif($logged_in == 1) {
?>
<div id="logged_redirect" class="border4">
	<img src="<?php echo getavatar($userdata['user_id'], $userdata['username']); ?>" border="0" class="comm_avatar border4" />
	<div align="center"><?php echo str_replace("%s", "index.php", $lang['login_msg15']); ?></div>
	</div>
<meta http-equiv="refresh" content="3;URL=index.php?login=1" />
<?php
}
?>
</div>
<?php
include('footer.php');
?>